<template>
	<div class="box"></div>
</template>

<script>
import _ from 'lodash'
export default {
	name: '',
	data() {
		return {

		}
	},
	mounted() {
		let obj = {
			a: 1,
			b: 2,
			c: {
				a: 1,
				b: 2,
				c: {
					a: 1,
					b: 2
				}
			},
			d: [1, 2, 3, 4, 5],
			e: [{
				a: 1,
				b: 2
			}]
		}
		let obj2 = {
			a: 3,
			b: 4,
			c: {
				a: 4,
				b: 5,
				c: {
					a: 6,
					b: 7
				}
			},
			d: [8, 9, 10, 11, 12],
			e: [{
				a: 13,
				b: 14
			}]
		}

		// const obj3 = _.merge(obj, obj2);
		// console.log(obj === obj3);
		// console.log(obj2 === obj3);
		// console.log(obj, obj3, obj2);

		const obj4 = _.mergeWith(obj, obj2, (oldValue, newValue) => {
			console.log('merge', oldValue, newValue);
			return newValue;
		});
	}
}
</script>
<style lang="scss" scoped>
.box {
	width: 100px;
	height: 100px;
	border: 1px solid #000;
}
</style>